home *** CD-ROM | disk | FTP | other *** search
/ Building Homes of Our Own / Building Homes of our Own.iso / setup / data1.cab / Everything / working / houCons.dxr / interface_407_PurchaseButton (Interiors).ls < prev    next >
Encoding:
Text File  |  2002-09-25  |  2.5 KB  |  90 lines

  1. property mySprite, myType, myName, myNameDown, myNameOver, myNameInactive, Active, ancestor, displaySprite, myStuffToPurchase
  2.  
  3. on beginSprite me
  4.   global gActorListMan
  5.   mySprite = me.spriteNum
  6.   myName = (the member of sprite mySprite).name
  7.   myNameDown = word 1 of myName && "down"
  8.   myNameOver = word 1 of myName && "over"
  9.   myNameInactive = word 1 of myName && "Inactive"
  10.   Active = 1
  11.   lookForToolTip = 1
  12.   ancestor = new(script("FourStatebuttonActions"), lookForToolTip)
  13.   myType = #selectButton
  14.   registerSprite(gActorListMan, mySprite)
  15. end
  16.  
  17. on mouseUp me
  18.   global gClickSprite, gConMan
  19.   if voidp(displaySprite) then
  20.     displaySprite = sendAllSprites(#sendSpriteNum, #IntDisplay)
  21.   end if
  22.   if not Active then
  23.     exit
  24.   end if
  25.   if gClickSprite = mySprite then
  26.     doButtonUpClick(myType, 1)
  27.     userChoice = sendSprite(displaySprite, #getCurChoice)
  28.     choiceCost = sendSprite(displaySprite, #getCurCost)
  29.     decision = sendSprite(displaySprite, #getCurDecisionType)
  30.     userInteriorChoice(gConMan, decision, userChoice, choiceCost)
  31.     put userChoice && "selected"
  32.     go(the frame + 1)
  33.   end if
  34. end
  35.  
  36. on enterFrame me
  37.   global gConMan
  38.   if voidp(displaySprite) then
  39.     displaySprite = sendAllSprites(#sendSpriteNum, #IntDisplay)
  40.   end if
  41.   curInteriorDecision = getNextInteriorDecision(gConMan)
  42.   curChoice = sendSprite(displaySprite, #getCurChoice)
  43.   if curInteriorDecision = #interiorAmenities then
  44.     if interiorItemPurchased(gConMan, curChoice) then
  45.       if Active then
  46.         setInactive(me)
  47.       end if
  48.     else
  49.       if not Active then
  50.         setActive(me)
  51.       end if
  52.     end if
  53.   else
  54.     if not Active then
  55.       setActive(me)
  56.     end if
  57.   end if
  58. end
  59.  
  60. on clearActorList me
  61.   if Active then
  62.     set the member of sprite the mySprite of me to member(myName)
  63.   else
  64.     set the member of sprite the mySprite of me to member(myNameInactive)
  65.   end if
  66. end
  67.  
  68. on endSprite me
  69.   global gActorListMan
  70.   unRegisterSprite(gActorListMan, mySprite)
  71. end
  72.  
  73. on getPropertyDescriptionList me
  74.   propList = [:]
  75.   rangeList = []
  76.   append(rangeList, #flooring_kitchen)
  77.   append(rangeList, #flooring_bathrooms)
  78.   append(rangeList, #flooring_otherRooms)
  79.   append(rangeList, #fireplaces)
  80.   append(rangeList, #staircases)
  81.   append(rangeList, #kitchen_styles)
  82.   append(rangeList, #kitchen_cabinets)
  83.   append(rangeList, #kitchen_CounterTops)
  84.   append(rangeList, #Bathrooms_styles)
  85.   append(rangeList, #interiorAmenities)
  86.   a = [#comment: "What is being purchased?", #format: #symbol, #range: rangeList, #default: rangeList[1]]
  87.   addProp(propList, #myStuffToPurchase, a)
  88.   return propList
  89. end
  90.